╔═══════════════════════════════════════════════════════════════════════════╗
║                  WHATSDESK PRO - CONFIGURATION SETUP                      ║
║          AI-Powered Multilingual WhatsApp CRM Configuration Guide         ║
╚═══════════════════════════════════════════════════════════════════════════╝

📋 TABLE OF CONTENTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. How the Bot Works
2. Google Cloud Translation Setup (Complete Tutorial)
3. Environment Configuration (.env)
4. Bot Capabilities
5. Admin Commands
6. Client Commands
7. Advanced Configuration
8. Multi-Language Support
9. Best Practices


═══════════════════════════════════════════════════════════════════════════
1. HOW THE BOT WORKS
═══════════════════════════════════════════════════════════════════════════

🔄 WORKFLOW OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

WhatsDesk Pro is a revolutionary AI-powered multilingual WhatsApp CRM system.

Unlike traditional chatbots or simple ticketing systems, WhatsDesk Pro combines:
• Intelligent ticket management
• Real-time multilingual translation (50+ languages)
• Multi-agent collaboration
• Business hours automation
• Advanced CRM capabilities

🏆 UNIQUE VALUE PROPOSITION:
No other solution offers this combination of features in a single platform.
WhatsDesk Pro is not just a chatbot - it's a complete customer relationship
management system specifically designed for global WhatsApp support teams.

✨ CORE CAPABILITIES:

✅ Automatic Language Detection
   • Detects client language by phone country code
   • Supports 50+ languages via Google Translate
   • Auto-translates messages for agents

✅ Ticket Management System
   • Creates tickets automatically
   • Routes messages between clients and agents
   • Maintains conversation history
   • Tracks ticket status (open, assigned, waiting, closed)

✅ Business Hours Management
   • Automatic out-of-hours messages
   • Configurable timezone support
   • Continues service if agent is already attending

✅ Multi-Agent Support
   • Multiple admins can manage tickets
   • One agent per ticket
   • Agent can skip tickets and return later
   • Real-time notifications


🔄 MESSAGE FLOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1. CLIENT → BOT:
   
   Client sends message (any language)
        ↓
   Bot detects language
        ↓
   Creates/updates ticket
        ↓
   Translates to agent's language (DEFAULT_LANGUAGE)
        ↓
   Sends to agent with original text
        ↓
   Saves to database


2. AGENT → CLIENT:
   
   Agent replies (DEFAULT_LANGUAGE)
        ↓
   Bot receives message
        ↓
   Translates to client's language
        ↓
   Sends to client
        ↓
   Saves to database


═══════════════════════════════════════════════════════════════════════════
2. GOOGLE CLOUD TRANSLATION SETUP (Complete Tutorial)
═══════════════════════════════════════════════════════════════════════════

🌐 OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Google Cloud Translation API v3 provides:
   • Professional-grade Neural Machine Translation (NMT)
   • Support for 100+ languages
   • High accuracy translations
   • Enterprise reliability

💰 PRICING:
   • First 500,000 characters/month: FREE
   • After free tier: $20 per 1 million characters
   • Billing enabled required (even for free tier)
   • Budget alerts recommended


📝 STEP-BY-STEP SETUP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

STEP 1: Create Google Cloud Account
─────────────────────────────────────────────────────────────────────────────

1. Go to: https://console.cloud.google.com/
2. Sign in with your Google account
3. Accept Terms of Service
4. You'll get $300 free credits for 90 days


STEP 2: Create a New Project
─────────────────────────────────────────────────────────────────────────────

1. Click "Select a project" (top left)
2. Click "NEW PROJECT"
3. Enter project details:
   
   Project Name: WhatsDesk-Pro-Translation
   Organization: (leave default)
   Location: (leave default)

4. Click "CREATE"
5. Wait for project creation (30 seconds)
6. Switch to your new project


STEP 3: Enable Translation API
─────────────────────────────────────────────────────────────────────────────

1. In the Search Bar, type: "Translation API"
2. Click "Cloud Translation API"
3. Click "ENABLE" button
4. Wait for API to be enabled (~1 minute)

✅ You should see: "API enabled"


STEP 4: Enable Billing (Required)
─────────────────────────────────────────────────────────────────────────────

⚠️  Note: Translation API requires billing even for free tier!
    You won't be charged until you exceed 500K chars/month.

1. Go to: Billing → Link a billing account
2. Click "CREATE BILLING ACCOUNT"
3. Select your country
4. Accept terms
5. Enter payment method:
   • Credit/Debit Card
   • Or use your $300 free credits
6. Submit

✅ Billing account created!


STEP 5: Create Service Account
─────────────────────────────────────────────────────────────────────────────

A Service Account is like a "robot user" for your bot to authenticate.

1. Go to: IAM & Admin → Service Accounts
   Or search: "Service Accounts" in search bar

2. Click "CREATE SERVICE ACCOUNT"

3. Fill in details:
   
   Service account name: whatsdesk-pro-translator
   Service account ID: whatsdesk-pro-translator
   Description: Translation service for WhatsDesk Pro CRM

4. Click "CREATE AND CONTINUE"

5. Grant permissions:
   
   Select role: "Cloud Translation API User"
   
   (Type "translation" in filter to find it)

6. Click "CONTINUE"

7. Skip "Grant users access" (click DONE)

✅ Service account created!


STEP 6: Create and Download JSON Key
─────────────────────────────────────────────────────────────────────────────

This is the most important step!

1. In Service Accounts list, find your account:
   whatsdesk-pro-translator@your-project.iam.gserviceaccount.com

2. Click on the email to open details

3. Go to "KEYS" tab

4. Click "ADD KEY" → "Create new key"

5. Choose format: JSON

6. Click "CREATE"

7. File will download automatically:
   your-project-id-xxxxxxxxxxxx.json

⚠️  IMPORTANT: Save this file securely! 
    This file contains credentials to use the API.
    Never share it publicly or commit to Git!

8. Rename file to something simple:
   
   google-credentials.json


STEP 7: Place JSON File in Bot Folder
─────────────────────────────────────────────────────────────────────────────

Windows:
   C:\Users\YourName\Documents\kryzeny-bot\google-credentials.json

Linux:
   /opt/thebotfolder-bot/google-credentials.json

The JSON file should contain:

{
  "type": "service_account",
  "project_id": "your-project-id",
  "private_key_id": "abc123...",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...",
  "client_email": "kryzeny-bot-translator@your-project.iam...",
  "client_id": "123456789...",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/..."
}


STEP 8: Get Your Project ID
─────────────────────────────────────────────────────────────────────────────

1. Go to: Google Cloud Console Dashboard
2. Look at the top of the page, you'll see:
   
   Project info
   ├─ Project name: WhatsDesk-Pro-Translation
   └─ Project ID: whatsdesk-pro-translation-123456

3. Copy the Project ID (not the name!)

Example:
   ✅ CORRECT: whatsdesk-pro-translation-123456
   ❌ WRONG: WhatsDesk-Pro-Translation


STEP 9: Configure .env File
─────────────────────────────────────────────────────────────────────────────

Open your .env file and set:

# Google Cloud Translation
GOOGLE_APPLICATION_CREDENTIALS=./google-credentials.json
GOOGLE_CLOUD_PROJECT_ID=whatsdesk-pro-translation-123456

Replace "whatsdesk-pro-translation-123456" with YOUR project ID!


STEP 10: Test the Translation
─────────────────────────────────────────────────────────────────────────────

Run the bot:

npm start

Check the console output:

✅ SUCCESSFUL:
   ✅ Google Translate inicializado com sucesso

❌ FAILED:
   ❌ Erro ao inicializar Google Translate
   
   Common errors:
   • "credentials not found" → Check file path
   • "project not found" → Check project ID
   • "API not enabled" → Go back to Step 3
   • "permission denied" → Check service account role


🔍 VERIFY API IS WORKING
─────────────────────────────────────────────────────────────────────────────

1. Send a message to the bot in another language
2. Bot should translate automatically
3. Check Google Cloud Console:
   
   APIs & Services → Dashboard → Translation API
   
   You should see API requests increasing!


💰 MONITOR USAGE & COSTS
─────────────────────────────────────────────────────────────────────────────

Go to: Google Cloud Console → Billing → Reports

Filter by: Cloud Translation API

You can see:
   • Characters translated
   • Cost per day
   • Remaining free quota

📊 FREE TIER: 500,000 characters/month
    
    Average ticket: 500 characters
    = 1,000 tickets per month FREE


⚠️  SET UP BUDGET ALERTS
─────────────────────────────────────────────────────────────────────────────

Protect yourself from unexpected charges!

1. Go to: Billing → Budgets & alerts
2. Click "CREATE BUDGET"
3. Set budget amount: $10 (or your preference)
4. Set alert at: 50%, 90%, 100%
5. Add your email
6. Save

You'll receive email alerts when reaching limits!


═══════════════════════════════════════════════════════════════════════════
3. ENVIRONMENT CONFIGURATION (.env)
═══════════════════════════════════════════════════════════════════════════

📝 COMPLETE .env CONFIGURATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

# ═══════════════════════════════════════════════════════════════════
# GOOGLE CLOUD TRANSLATION
# ═══════════════════════════════════════════════════════════════════

# Path to your Google Cloud credentials JSON file
# Can be relative (./filename.json) or absolute (C:/path/to/file.json)
GOOGLE_APPLICATION_CREDENTIALS=./google-credentials.json

# Your Google Cloud Project ID (NOT the project name!)
# Find it in: Google Cloud Console → Dashboard → Project Info
GOOGLE_CLOUD_PROJECT_ID=your-project-id-123456


# ═══════════════════════════════════════════════════════════════════
# LANGUAGE SETTINGS
# ═══════════════════════════════════════════════════════════════════

# Default language for your team/agents
# All messages will be translated TO this language
# Options: en, pt, es, fr, de, it, ru, zh, ja, ko, ar, hi, etc.
DEFAULT_LANGUAGE=en

# Fallback language if detection fails
FALLBACK_LANGUAGE=en


# ═══════════════════════════════════════════════════════════════════
# BUSINESS HOURS (Timezone: Africa/Maputo = GMT+2)
# ═══════════════════════════════════════════════════════════════════

# Your timezone (IANA format)
# Examples: America/New_York, Europe/London, Asia/Tokyo
TIMEZONE=Africa/Maputo

# Business hours in 24-hour format (HH:MM)
BUSINESS_HOURS_START=08:00
BUSINESS_HOURS_END=18:00

# Business days (0=Sunday, 1=Monday, ..., 6=Saturday)
# Monday to Friday: 1,2,3,4,5
BUSINESS_DAYS=1,2,3,4,5


# ═══════════════════════════════════════════════════════════════════
# ADMIN CONFIGURATION
# ═══════════════════════════════════════════════════════════════════

# WhatsApp numbers for admins (with country code, no + or spaces)
# Multiple admins separated by commas
# Example: 258840000000,258850000000
ADMIN_NUMBERS=258840000000,258850000000


# ═══════════════════════════════════════════════════════════════════
# TIMEOUT SETTINGS
# ═══════════════════════════════════════════════════════════════════

# Minutes until ticket auto-closes if no agent accepts
TICKET_TIMEOUT_MINUTES=15

# Minutes until agent is reminded about unanswered client
AGENT_RESPONSE_TIMEOUT_MINUTES=5

# Hours until ticket auto-closes if client doesn't respond
CLIENT_RESPONSE_TIMEOUT_HOURS=24


# ═══════════════════════════════════════════════════════════════════
# DATABASE
# ═══════════════════════════════════════════════════════════════════

# SQLite database path
DATABASE_PATH=./data/bot.db


# ═══════════════════════════════════════════════════════════════════
# WPP Connect
# ═══════════════════════════════════════════════════════════════════

# Session name for WhatsApp connection
# Change if you want multiple instances
SESSION_NAME=whatsdesk-pro


# ═══════════════════════════════════════════════════════════════════
# MEDIA SETTINGS
# ═══════════════════════════════════════════════════════════════════

# Maximum media file size in MB
MAX_MEDIA_SIZE_MB=100


═══════════════════════════════════════════════════════════════════════════
4. BOT CAPABILITIES
═══════════════════════════════════════════════════════════════════════════

✅ AUTOMATIC FEATURES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🌍 Language Detection
   • Detects client language by phone country code
   • Auto-translates all messages
   • Supports 50+ languages

🎫 Ticket Management
   • Auto-creates tickets
   • Tracks ticket status
   • Saves all messages
   • Media support (images, videos, audio, documents)

🔄 Message Translation
   • Client → Agent: Translates to DEFAULT_LANGUAGE
   • Agent → Client: Translates to client's language
   • Shows original text alongside translation

⏰ Business Hours
   • Auto-responds outside business hours
   • Continues if agent is already attending
   • Configurable timezone and hours

📊 Database Storage
   • SQLite database
   • Client profiles
   • Ticket history
   • Message logs

🔔 Notifications
   • New ticket alerts
   • Client response alerts
   • Ticket status updates


═══════════════════════════════════════════════════════════════════════════
5. ADMIN COMMANDS
═══════════════════════════════════════════════════════════════════════════

📋 TICKET MANAGEMENT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

/listar tickets
   Lists all open tickets with details
   
   Example output:
   📋 Tickets Abertos (3)
   
   #1 - João Silva (258866961903)
   🌍 Português | ⏰ 10 min atrás
   📝 Problema com servidor
   
   #2 - Maria Santos (5511999887766)
   🌍 Português | ⏰ 5 min atrás
   👤 Atendendo: Carlos


/ticket [ID]
   View complete ticket history
   
   Example: /ticket 1


/atender [phone]
   Accept and start attending a ticket
   
   Example: /atender 258866961903
   
   What happens:
   • You become the assigned agent
   • Client is notified
   • All previous messages are forwarded to you
   • Client's new messages come directly to you


/fechar ticket
   Close your current ticket
   
   What happens:
   • Ticket is marked as closed
   • Client is notified
   • You can accept another ticket


/pular
   Skip current client (ticket returns to queue)
   
   Use when:
   • Client is not responding
   • You want to help another client
   • Will return to this client later
   
   What happens:
   • Ticket status → 'waiting'
   • Your assignment is removed
   • If client responds, you're notified
   • You can return with /atender [phone]

/notify [phone]
   Send a one-off notification to a previously registered client WITHOUT opening a ticket
   
   • Only works for clients that already exist in the database (security)
   • Flow: type messages (and media) → finish with /send
   • Client receives a context banner that this is NOT an active ticket and sees /abrir ticket and /ajuda

/cancel
   Cancel the current operation (notification, transfer, etc.)

/ajuda
   Show all available commands


═══════════════════════════════════════════════════════════════════════════
6. CLIENT COMMANDS
═══════════════════════════════════════════════════════════════════════════

🎫 TICKET COMMANDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

/abrir ticket
   (Also: /open ticket, /ouvrir ticket, /öffnen ticket)
   
   Start creating a new support ticket
   
   Flow:
   1. Bot asks for your name
   2. Bot asks if you have an account
   3. Bot asks for problem description
   4. You can send text, images, videos, audio
   5. Send /enviar to complete

/enviar
   (Also: /send, /envoyer, /senden)
   
   Complete and submit your ticket
   Admins are notified immediately

/fechar ticket
   (Also: /close ticket, /cerrar ticket, /fermer ticket)
   
   Close your own ticket
   
   Bot will ask for reason:
   • Problem solved
   • Don't need help anymore
   • Other reason

👤 PROFILE COMMANDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

/perfil
   (Also: /profile, /profil, /profilo)
   
   View your saved information
   Shows: name, account info, language

/editar perfil
   (Also: /edit profile, /modifier profil)
   
   Update your information
   Can change: name, account

🌍 LANGUAGE COMMANDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

/alterar idioma [code]
   (Also: /change language, /cambiar idioma, /changer langue)
   
   Change your preferred language
   
   Examples:
   /alterar idioma pt   → Portuguese
   /alterar idioma en   → English
   /alterar idioma es   → Spanish
   /alterar idioma fr   → French
   /alterar idioma de   → German
   /alterar idioma it   → Italian
   /alterar idioma ru   → Russian
   /alterar idioma zh   → Chinese
   /alterar idioma ja   → Japanese
   /alterar idioma ko   → Korean
   /alterar idioma ar   → Arabic

/ajuda
   (Also: /help, /ayuda, /aide, /hilfe)
   
   Show all available commands


═══════════════════════════════════════════════════════════════════════════
7. ADVANCED CONFIGURATION
═══════════════════════════════════════════════════════════════════════════

🔧 CUSTOM TIMEZONES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Common timezones (IANA format):

Africa:
   Africa/Maputo          → GMT+2 (Mozambique)
   Africa/Johannesburg    → GMT+2 (South Africa)
   Africa/Lagos           → GMT+1 (Nigeria)
   Africa/Cairo           → GMT+2 (Egypt)

Americas:
   America/New_York       → EST/EDT (USA East)
   America/Los_Angeles    → PST/PDT (USA West)
   America/Chicago        → CST/CDT (USA Central)
   America/Sao_Paulo      → BRT (Brazil)
   America/Mexico_City    → CST (Mexico)

Europe:
   Europe/London          → GMT/BST (UK)
   Europe/Paris           → CET/CEST (France)
   Europe/Berlin          → CET/CEST (Germany)
   Europe/Moscow          → MSK (Russia)

Asia:
   Asia/Dubai             → GST (UAE)
   Asia/Kolkata           → IST (India)
   Asia/Shanghai          → CST (China)
   Asia/Tokyo             → JST (Japan)

Find yours: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones


🔧 BUSINESS DAYS CONFIGURATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Day numbers:
   0 = Sunday
   1 = Monday
   2 = Tuesday
   3 = Wednesday
   4 = Thursday
   5 = Friday
   6 = Saturday

Examples:

Monday to Friday:
   BUSINESS_DAYS=1,2,3,4,5

Monday to Saturday:
   BUSINESS_DAYS=1,2,3,4,5,6

Only weekdays except Wednesday:
   BUSINESS_DAYS=1,2,4,5

24/7 service:
   BUSINESS_DAYS=0,1,2,3,4,5,6


═══════════════════════════════════════════════════════════════════════════
8. MULTI-LANGUAGE SUPPORT
═══════════════════════════════════════════════════════════════════════════

🌍 SUPPORTED LANGUAGES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The bot automatically detects and translates:

Code | Language           | Native Name
─────┼────────────────────┼──────────────────────
 pt  | Portuguese         | Português
 en  | English            | English
 es  | Spanish            | Español
 fr  | French             | Français
 de  | German             | Deutsch
 it  | Italian            | Italiano
 ru  | Russian            | Русский
 zh  | Chinese (Simp)     | 中文
 ja  | Japanese           | 日本語
 ko  | Korean             | 한국어
 ar  | Arabic             | العربية
 hi  | Hindi              | हिन्दी
 bn  | Bengali            | বাংলা
 tr  | Turkish            | Türkçe
 vi  | Vietnamese         | Tiếng Việt
 th  | Thai               | ไทย
 nl  | Dutch              | Nederlands
 pl  | Polish             | Polski
 sv  | Swedish            | Svenska
 da  | Danish             | Dansk
 no  | Norwegian          | Norsk
 fi  | Finnish            | Suomi

+ 50 more languages!


🌍 AUTO-DETECTION BY COUNTRY CODE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Phone examples:

+258 866961903   → Detected: Portuguese (Mozambique)
+55 11 99988776  → Detected: Portuguese (Brazil)
+1 555 123 4567  → Detected: English (USA)
+34 612 345 678  → Detected: Spanish (Spain)
+33 6 12 34 56   → Detected: French (France)
+49 151 23456    → Detected: German (Germany)
+86 138 0000 000 → Detected: Chinese (China)


═══════════════════════════════════════════════════════════════════════════
9. BEST PRACTICES
═══════════════════════════════════════════════════════════════════════════

✅ SECURITY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1. Never share google-credentials.json
2. Add to .gitignore:
   
   google-credentials.json
   .env
   data/*.db

3. Restrict admin numbers
4. Regular backups of database
5. Monitor API usage


✅ PERFORMANCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1. Use PM2 for production
2. Set up log rotation
3. Monitor memory usage
4. Clean old tickets periodically
5. Backup database weekly


✅ USER EXPERIENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1. Respond to tickets quickly
2. Use /pular if client is slow to respond
3. Close tickets when resolved
4. Review ticket history before responding
5. Train team on commands


✅ MAINTENANCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Daily:
   • Check bot is running
   • Review ticket queue
   • Monitor Google Cloud usage

Weekly:
   • Backup database
   • Check logs for errors
   • Review closed tickets

Monthly:
   • Update dependencies: npm update
   • Review API costs
   • Clean old logs


═══════════════════════════════════════════════════════════════════════════
10. PRODUCTION (Linux/PM2)
═══════════════════════════════════════════════════════════════════════════

Use PM2 to keep the bot running in production on Linux servers.

Install PM2 globally:

   npm install pm2 -g

Start the bot in production:

   npm run prod

Optional: watch for file changes and auto-restart:

   npm run prod:watch

Save PM2 process list and enable startup on boot:

   pm2 save
   pm2 startup

View logs:

   pm2 logs whatsdesk-pro

If you change environment files or config, restart:

   pm2 restart whatsdesk-pro


🔎 Agent Display Names (Randomized)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Configure the list of random agent names in:
   config/config.js → `agents` array

Example excerpt:
   agents: [
     'Pedro Silva',
     'Maria Santos',
     'João Costa',
     'Ana Oliveira',
     'Carlos Ferreira',
     'Sofia Rodrigues'
   ]


📚 Appendix: Complete Commands Reference
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

AGENT COMMANDS
───────────────

/listar tickets | /list tickets         → List all open tickets
/closed tickets                        → List last 20 closed tickets
/ticket [ID]                           → View ticket history by ID
/atender [phone] | /accept [phone]     → Accept a ticket from queue
/fechar ticket | /close ticket         → Close current ticket
/pular | /skip                         → Skip current client (back to queue)
/agents | /agentes                     → List available agents
/transfer [phone] | /transferir [phone]→ Transfer current conversation
/accept | /aceitar                     → Accept a pending transfer
/notify [phone]                        → Start notification flow; finish with /send
/cancel                                → Cancel current operation
/ajuda | /help                          → Show all available commands

CLIENT COMMANDS
───────────────

/abrir ticket | /open ticket            → Start creating a new ticket
/enviar | /send                         → Submit your ticket
/fechar ticket | /close ticket          → Close your ticket
/perfil | /profile                      → View your saved information
/editar perfil | /edit profile          → Update your information
/alterar idioma [code] | /change language [code] → Change language
/ajuda | /help                          → Show all available commands


═══════════════════════════════════════════════════════════════════════════

✅ Configuration complete! 
   
   Need help? Check INSTALLATION_SETUP.txt
   See changes? Check CHANGELOG.txt

═══════════════════════════════════════════════════════════════════════════
